class Solution(object):
    def numUniqueEmails(self, emails):
        """
        :type emails: List[str]
        :rtype: int
        """
        def convert(s):
            s = s.split('@')
            s[0] = s[0].split('+')[0]
            s[0] = ''.join(s[0].split('.'))
            return s[0] + '@' + s[1]
        return len({convert(s) for s in emails})


data = Solution()
emails = ["test.email+alex@leetcode.com", "test.e.mail+bob.cathy@leetcode.com", "testemail+david@lee.tcode.com"]
print(data.numUniqueEmails(emails))
